package com;

import com.Dao.UserDao;
import com.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@ComponentScan//扫描项目中的bean类
@Configuration//说明本项目是IOC类
@EnableAspectJAutoProxy
public class AppConfig {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
        @@ -22,5 +25,10 @@ public class AppConfig {
        else{
                System.out.println("登陆失败");
            }
            UserDao userDao = ctx.getBean(UserDao.class);
        userDao.select();
        userDao.update();
        userDao.delete();
        userDao.insert();
        }
    }